import url, { mainUrl } from "../utils/url.js"
import util from "../utils/util.js"


let myUrl = require("../utils/url.js")

let requests = require("../utils/requests.js")

/**
 * 获取轮播图片
 */
export function getLoopPic(){
  return requests.fatch({
    load: 0,
    url: myUrl.mainUrl + "banner/"
  })
}

/**
 * 获取分类
 */
export function category(){
  return requests.fatch({
    load: 0,
    url: myUrl.mainUrl + "category/"
  })
}

/**
 * 获取热门课程
 */
export function hotCourse(page_num){
  return requests.fatch({
    load: 0,
    data:{
      page: page_num
    },
    url: myUrl.mainUrl + "course/?is_hot=true"
  })
}

/**
 * 获取一级分类下的商品
 */
export function getLevel1CategoryCourse(category_id){

  return requests.fatch({
    load: 0,
    url: myUrl.mainUrl + "indexcourse/?id=" + category_id
  })

}